# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Martin C. Doege <mdoege at compuserve dot com>
# Contributor: Ray Rashif <schiv@archlinux.org>
# Contributor: Shinlun Hsieh <yngwiexx@yahoo.com.tw>

pkgname=liblscp
pkgver=0.9.9
pkgrel=1
pkgdesc="LinuxSampler Control Protocol C++ library"
arch=(loong64 x86_64)
url="https://github.com/rncbc/liblscp"
license=(LGPL2.1)
depends=(glibc)
makedepends=(cmake)
provides=(liblscp.so)
source=(https://github.com/rncbc/liblscp/archive/${pkgname}_${pkgver//./_}/$pkgname-${pkgname}_${pkgver//./_}.tar.gz)
sha512sums=('90839f4d2bf81a2fdcb68d97b2f601cc9193b1e7b47ee94bc11798e45fb04e801d70a0ff1de30e1fb4cd0022b69850c2ad861fd4593ae28e0f201bd947f56d02')
b2sums=('19f5bac246c9be77a06cf791da09b2b6023cbfcc3100ba8dea1f2627c061903708baf93ee6f899450f842119853037179267702c203db8a7267010ee112e2e81')

build() {
  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -S $pkgname-${pkgname}_${pkgver//./_}
    -W no-dev
  )

  cmake "${cmake_options[@]}"
  cmake --build build --verbose
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -vDm 644 $pkgname-${pkgname}_${pkgver//./_}/{ChangeLog,README} -t "$pkgdir/usr/share/doc/$pkgname/"
}

